import http from '@/utils/http'
import { DeptQuery, DeptVO } from '@/apis/types'
import { AxiosPromise } from 'axios'

// 查询部门列表
export const listCity = (query?: DeptQuery) => {
  return http.get('/sdsp-report/report/city/list', query)
}

class UserVO {}

/**
 * 查询当前部门的所有用户信息
 * @param deptId
 */
export const listUserByDeptId = (deptId: string | number): AxiosPromise<UserVO[]> => {
  return http.get('/system/user/list/dept/' + deptId)
}

// 删除部门
export const delDept = (deptId: number | string) => {
  return http.delete('/system/dept/' + deptId)
}

// 查询部门详细
export const getDept = (deptId: string | number): AxiosPromise<DeptVO> => {
  return http.get('/system/dept/' + deptId)
}

// 查询部门列表（排除节点）
export const listDeptExcludeChild = (deptId: string | number): AxiosPromise<DeptVO[]> => {
  return http.get('/system/dept/list/exclude/' + deptId)
}
